]> dgit.raspbian.org Git - gnome-shell.git/commit
workspace: Check if index is valid before using it
authorIvan Molodetskikh <yalterz@gmail.com>
Sat, 27 Feb 2021 06:59:21 +0000 (09:59 +0300)
committerMarge Bot <marge-bot@gnome.org>
Wed, 3 Mar 2021 19:56:45 +0000 (19:56 +0000)
commit35fb221a7ea99cbc0a7f50782c2b52ab461a21ab
tree48ea94c7476070f82467523a1476367f6814cac6
parentff163a03b903184b4ad6ae37307c3e682c4c1da7
workspace: Check if index is valid before using it

If the window wasn't in _windowSlots, the index is -1, so the last
element of the array is removed, leading to
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3547

I logged the stack trace from removeWindow() and it seems that when you
move the window from the second monitor to another workspace like shown
in https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3547,
removeWindow() is called twice for it, presumably once for the second
monitor workspace, and then once for the first monitor workspace for
some reason. It is during that call that _windowSlots doesn't contain
the window, so instead the last element (index -1) is removed, leading
to the animation bug.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1727>
js/ui/workspace.js